package com.gary.mapper;

import com.gary.entity.User;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * @author pengrui
 * @date 2020/11/26 - 14:12
 */
public interface UserMapper {

    /**
     *  通过ID查询
     * @param id
     * @return
     */
    @Select("select * from user where id = #{id}")
    User queryById(Integer id);

    /**
     *  更新员工操作
     * @param user
     */
    @Update("UPDATE `user` SET user_name = 'aa', `password` = 'bbb' WHERE id = #{user.id};")
    void updateUser(User user);
}
